import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '版本号',
    align: 'center',
    dataIndex: 'code',
  },
  {
    title: '版本名',
    align: 'center',
    dataIndex: 'name',
  },
  {
    title: '路径',
    align: 'center',
    dataIndex: 'path',
  },
  {
    title: '备注',
    align: 'center',
    dataIndex: 'remark',
  },
  {
    title: '最新',
    align: 'center',
    dataIndex: 'isNew_dictText',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'code',
    field: 'code',
    component: 'Input',
  },
  {
    label: 'name',
    field: 'name',
    component: 'Input',
  },
  {
    label: 'APP软件',
    field: 'path',
    component: 'JUpload',
    componentProps: {
      fileMax: 1,
    },
  },
  {
    label: 'remark',
    field: 'remark',
    component: 'Input',
  },
  {
    label: 'isNew',
    field: 'isNew',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'yn',
      placeholder: '请选择',
      stringToNumber: true,
    },
  },
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  code: {title: 'code',order: 0,view: 'text', type: 'string',},
  name: {title: 'name',order: 1,view: 'text', type: 'string',},
  path: {title: 'path',order: 2,view: 'text', type: 'string',},
  remark: {title: 'remark',order: 3,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}